package org.tigris.mappedlexer.validator.implementation;

import org.tigris.mappedlexer.validator.*;

/**
 * A verifier focus on verifying the inputed source only contains alpha and
 * numeric.
 * 
 * @author zhisen.huang
 * @see AlphaValidator
 * @see NumericVerifer
 * @see SpaceValidator
 */
public class AlphaNumericValidator extends CompositeValidator {

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	@Override
	public boolean validate(char chr) throws UnsupportedOperationException {
		// why '@'? it stands for that the identifier is an interface type but
		// not else.
		return VerifyHub.ALPHA.validate(chr) || VerifyHub.NUMERIC.validate(chr)
				|| chr == '.' || chr == '_' || chr == '@';
	}

}
